package main

import (
	"fmt"
	"time"
)

//协程

func new_routine() {
	for {
		i := 0
		fmt.Println("this is a new rountine!  ", i)
		time.Sleep(1 * time.Second)
		i++
	}
}

func main() {
	// go 创建一个协程执行新任务
	// runtime.Goexit()
	go new_routine()
	for {
		i := 0
		fmt.Println("this is a main rountine!  ", i)
		time.Sleep(1 * time.Second)
		i++
	}
}
